//
//  AppController.m
//  AKLocalClient
//
//  Created by Yun Qing Teng on 11/13/06.
//  Copyright 2006 __MyCompanyName__. All rights reserved.
//

#import "AppController.h"


@implementation AppController
-(void)awakeFromNib {
	client = [[AKLocalClient alloc] init];
	[client setDelegate:self];
}

-(IBAction)refreshService:(id)sender {
	service = [client availableServices];
	[serviceList reloadData];
}

-(IBAction)subcribe:(id)sender {
	[client subscribeToService:[service objectAtIndex:[serviceList selectedRow]]];
}

-(void)subscribingDidSucceed {
	NSLog(@"success");
}

- (int)numberOfRowsInTableView:(NSTableView *)theTableView {
    return [service count];
}


- (id)tableView:(NSTableView *)theTableView objectValueForTableColumn:(NSTableColumn *)theColumn row:(int)rowIndex {
    NSLog(@"abc");
	return [[service objectAtIndex:rowIndex] name];
}

- (IBAction)sendMessage:(id)sender {
	[client sendMessage:[text stringValue]];
}
@end
